home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tcekbd.arc / DEMO.C < prev    next >
Text File  |  1990-10-21  |  907b  |  38 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3. #include <ctype.h>
  4. #include "bioskeye.h"
  5.  
  6. #define ESC    0x011B
  7.  
  8. int main(void)
  9. {
  10.    int key, modifiers;
  11.    int done;
  12.  
  13.    printf("\n");
  14.    printf("Extended Keyboard 'BIOSKEYE' Demo Utility\n\n");
  15.    printf("Press ESC to quit\n\n");
  16.    done = 0;
  17.    while(!done) {
  18.       /* -----------------function 1 returns 0 until a key is pressed */
  19.       while(bioskeye(1) == 0);
  20.  
  21.       /* ------------------function 0 returns the key that is waiting */
  22.       key = bioskeye(0);
  23.  
  24.       /* ----------use function 2 to determine if shit keys were used */
  25.       modifiers = bioskeye(2);
  26.  
  27.       /* --------------------------------print out the character read */
  28.       printf("Key pressed was: ");
  29.       printf("Value=%04Xh, ",key);
  30.       printf("Shift Status=%04Xh\r",modifiers);
  31.  
  32.      if (key == ESC) done = 1;
  33.    }
  34.    printf("\n");
  35.  
  36.    return 0;
  37. }
  38.